//
//  AppPushHandleTool.m
//  com.yjwh.yj
//
//  Created by ferver7 on 2018/12/7.
//  Copyright © 2018 ferver7. All rights reserved.
//

/*
 pushType 推送类型
type:0:系统的；1活动的；2订单的；3无需跳页面；    contentHtml:type为1时的活动页面
 */
#import "AppPushHandleTool.h"


@implementation AppPushHandleTool
+(void)handlePushInfoForAppStart:(NSDictionary *)pushInfo WithRootViewController:(id)viewController
{
    UIViewController * rootVc = (UIViewController *)viewController;
    if ([pushInfo[@"pushType"] isEqualToString:@"appraisalReply"]) {
//        EVADetailViewController * evad = mGetStoryboardViewController(@"Main", @"eVADetailViewController");
//        evad.ID = pushInfo[@"serviceId"];
//        evad.showSelfEVA = YES;
//        [rootVc.navigationController pushViewController:evad animated:YES];
    }
   
}
+(void)handlePushInfoForAppRuning:(NSDictionary *)pushInfo
{
    UIWindow *window = [[UIApplication sharedApplication].delegate window];
    UIViewController *topViewController = [window rootViewController];
    if (topViewController.presentedViewController) {
        topViewController = topViewController.presentedViewController;
    } else if ([topViewController isKindOfClass:[UINavigationController class]] && [(UINavigationController*)topViewController topViewController]) {
        topViewController = [(UINavigationController *)topViewController topViewController];
    } else if([topViewController isKindOfClass:[UITabBarController class]]) {
        UITabBarController *tab = (UITabBarController *)topViewController;
        topViewController = tab.selectedViewController;
        if ([pushInfo[@"pushType"] isEqualToString:@"appraisalReply"]) {
//            EVADetailViewController * evad = mGetStoryboardViewController(@"Main", @"eVADetailViewController");
//            evad.ID = pushInfo[@"serviceId"];
//            evad.showSelfEVA = YES;
//            [tab.selectedViewController pushViewController:evad animated:YES];
        }
     
    }
}

@end
